// BEGIN CUT HERE
package p400.srm409;

import static utils.ExampleRunner.eq;

public class OrderedSuperString {
  public int getLength(String[] words) {
    String superstring = "";
    int last = 0;
    for (String w : words) {
      while (true) {
        String nxt = superstring;
        if (nxt.length() < last + w.length()) {
          nxt = nxt + w.substring(nxt.length() - last);
        }
//                System.out.println("nxt = " + nxt);
//                System.out.println(String.format("nxt.substring(%d, %d) = %s", last, last + w.length(), nxt.substring(last, last + w.length())));
        if (w.equals(nxt.substring(last, last + w.length()))) {
          superstring = nxt;
//                    System.out.println("superstring = " + superstring);
          break;
        }
        ++last;
//                System.out.println("last = " + last);
      }
    }
//        System.out.println("superstring = " + superstring);
    return superstring.length();
  }

  public int getLength2(String[] words) {
    String superstring = words[0];
    int prevMatch = 0;
    for (int i = 1; i < words.length; i++) {
      String word = words[i];
      prevMatch = superstring.indexOf(word, prevMatch);
      if (prevMatch == -1) {
        superstring = joinString(superstring, word);
        prevMatch = superstring.indexOf(word, prevMatch);
      }
    }
    System.out.println("superstring = " + superstring);
    return superstring.length();
  }

  private String joinString(String left, String right) {
    int len = Math.min(left.length(), right.length());
    int i = 0;
    while (i < len && left.charAt(left.length() - i - 1) == right.charAt(i)) {
      i++;
    }
    return left + right.substring(i);
  }

  // BEGIN CUT HERE
  public static void main(String[] args) {
    try {
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "ca"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "a", "b", "a"}), 3);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "ab", "bc", "de", "ef"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "bc", "de", "ef", "abcdef"}), 12);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a"}), 1);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bc", "abc"}), 5);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "abc"}), 3);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaaaaaaaabaaaaaaaa", "bac", "aaaabacaaa", "ab", "ba", "a", "ca"}), 33);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcd", "bc", "ba"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaaaaaaa", "a", "ab", "a", "abbbb"}), 14);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bcdefgh", "b", "b", "b", "bc", "cd", "g", "gaa"}), 10);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"x", "w", "v", "u", "t", "s", "r", "q", "p", "o", "n", "m", "l", "k", "j", "i", "h", "g", "f", "e", "d", "c", "b", "a", "z", "y", "x", "w", "v", "u", "t", "s", "r", "q", "p", "o", "n", "m", "l", "k", "j", "i", "h", "g", "f", "e", "d", "c", "b", "a"}), 50);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaa", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa", "aaaaaaaaaaaaa", "aaaaaaaaaaaa", "aaaaaaaaaaa", "aaaaaaaaaa", "aaaaaaaaa", "aaaaaaaa", "aaaaaaa", "aaaaaa", "aaaaa", "aaaa", "aaa", "aa", "a"}), 50);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopq", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnop", "abcdefghijklmnopqrstuvwxyzabcdefghijklmno", "abcdefghijklmnopqrstuvwxyzabcdefghijklmn", "abcdefghijklmnopqrstuvwxyzabcdefghijklm", "abcdefghijklmnopqrstuvwxyzabcdefghijkl", "abcdefghijklmnopqrstuvwxyzabcdefghijk", "abcdefghijklmnopqrstuvwxyzabcdefghij", "abcdefghijklmnopqrstuvwxyzabcdefghi", "abcdefghijklmnopqrstuvwxyzabcdefgh", "abcdefghijklmnopqrstuvwxyzabcdefg", "abcdefghijklmnopqrstuvwxyzabcdef", "abcdefghijklmnopqrstuvwxyzabcde", "abcdefghijklmnopqrstuvwxyzabcd", "abcdefghijklmnopqrstuvwxyzabc", "abcdefghijklmnopqrstuvwxyzab", "abcdefghijklmnopqrstuvwxyza", "abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxy", "abcdefghijklmnopqrstuvwx", "abcdefghijklmnopqrstuvw", "abcdefghijklmnopqrstuv", "abcdefghijklmnopqrstu", "abcdefghijklmnopqrst", "abcdefghijklmnopqrs", "abcdefghijklmnopqr", "abcdefghijklmnopq", "abcdefghijklmnop", "abcdefghijklmno", "abcdefghijklmn", "abcdefghijklm", "abcdefghijkl", "abcdefghijk", "abcdefghij", "abcdefghi", "abcdefgh", "abcdefg", "abcdef", "abcde", "abcd", "abc", "ab", "a"}), 50);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "ab", "abc", "abcd", "abcde", "abcdef", "abcdefg", "abcdefgh", "abcdefghi", "abcdefghij", "abcdefghijk", "abcdefghijkl", "abcdefghijklm", "abcdefghijklmn", "abcdefghijklmno", "abcdefghijklmnop", "abcdefghijklmnopq", "abcdefghijklmnopqr", "abcdefghijklmnopqrs", "abcdefghijklmnopqrst", "abcdefghijklmnopqrstu", "abcdefghijklmnopqrstuv", "abcdefghijklmnopqrstuvw", "abcdefghijklmnopqrstuvwx", "abcdefghijklmnopqrstuvwxy", "abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyza", "abcdefghijklmnopqrstuvwxyzab", "abcdefghijklmnopqrstuvwxyzabc", "abcdefghijklmnopqrstuvwxyzabcd", "abcdefghijklmnopqrstuvwxyzabcde", "abcdefghijklmnopqrstuvwxyzabcdef", "abcdefghijklmnopqrstuvwxyzabcdefg", "abcdefghijklmnopqrstuvwxyzabcdefgh", "abcdefghijklmnopqrstuvwxyzabcdefghi", "abcdefghijklmnopqrstuvwxyzabcdefghij", "abcdefghijklmnopqrstuvwxyzabcdefghijk", "abcdefghijklmnopqrstuvwxyzabcdefghijkl", "abcdefghijklmnopqrstuvwxyzabcdefghijklm", "abcdefghijklmnopqrstuvwxyzabcdefghijklmn", "abcdefghijklmnopqrstuvwxyzabcdefghijklmno", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnop", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopq", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx"}), 50);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"xyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu", "wxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst", "vwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs", "uvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr", "tuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq", "stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop", "rstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno", "qrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn", "pqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm", "opqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl", "nopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk", "mnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij", "lmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi", "klmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh", "jklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg", "ijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", "hijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde", "ghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd", "fghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc", "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab", "defghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza", "cdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", "bcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx", "zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw", "yzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv", "xyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu", "wxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst", "vwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs", "uvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr", "tuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq", "stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop", "rstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno", "qrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn", "pqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm", "opqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl", "nopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk", "mnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij", "lmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi", "klmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh", "jklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg", "ijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef", "hijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde", "ghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd", "fghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc", "efghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab", "defghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza", "cdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", "bcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy", "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx"}), 1275);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww", "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv", "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", "tttttttttttttttttttttttttttttttttttttttttttttttttt", "ssssssssssssssssssssssssssssssssssssssssssssssssss", "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr", "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", "pppppppppppppppppppppppppppppppppppppppppppppppppp", "oooooooooooooooooooooooooooooooooooooooooooooooooo", "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "llllllllllllllllllllllllllllllllllllllllllllllllll", "kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk", "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj", "iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii", "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", "gggggggggggggggggggggggggggggggggggggggggggggggggg", "ffffffffffffffffffffffffffffffffffffffffffffffffff", "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "dddddddddddddddddddddddddddddddddddddddddddddddddd", "cccccccccccccccccccccccccccccccccccccccccccccccccc", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww", "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv", "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", "tttttttttttttttttttttttttttttttttttttttttttttttttt", "ssssssssssssssssssssssssssssssssssssssssssssssssss", "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr", "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", "pppppppppppppppppppppppppppppppppppppppppppppppppp", "oooooooooooooooooooooooooooooooooooooooooooooooooo", "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn", "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm", "llllllllllllllllllllllllllllllllllllllllllllllllll", "kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk", "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj", "iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii", "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", "gggggggggggggggggggggggggggggggggggggggggggggggggg", "ffffffffffffffffffffffffffffffffffffffffffffffffff", "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "dddddddddddddddddddddddddddddddddddddddddddddddddd", "cccccccccccccccccccccccccccccccccccccccccccccccccc", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}), 2500);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"rghkbwi", "ivorhalqkbqpqaeqeacboyejxxomi", "nhwphyjwbysksgullfvjsjzwaktsdfvqa", "vjsjzwaktsdfvq", "d", "zhlt", "kvloqsdoksbq", "vemdtdtocsmhpxrwdwpzvxegcubmfbnpntyqojgg", "vnwzgsylralekpkaoocfgfiqtwjxhemmkkbfrihxg", "nwzgsylralekpkaoocfgfiqtwjxhemmkkbfrihxgcjxakd", "etwbtathbjyvutvsaeoidxts", "tvsaeoidxtsqbbhulpbvgdlzilpath", "vz", "dmjtdvdzcy", "igycthymbvvfzuslkhugfwatpqhmwsxfes", "bvvfzuslkhugfwatpqhmwsxfesjxfpqogbpykostghngcox", "fesjxfpqogbpykostghngc", "jfodgjftohmljyelwmeovdahtfzfwyulkaqnhnxslsyic", "meovdahtfzfwyulkaqnhnxslsyicigodpkengfuxfxut", "odpkengfuxfxutrdeacvxgrrfnuukjjer", "ergsuxt", "c", "jekugycnpcvrhoqk", "qjszovdqammidbbnhf", "ovdqammi", "won", "msxlrfiewhdvypdyplducspjqpa", "spjqpaqyakidortqytvcvderwodzuwz", "ozepdsgqcs", "hoec"}), 470);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ioxennltbaqibvskinaepgelanr", "ednqpvrefnpnv", "tllilzmorkymtrvudy", "yppsbcybqphszhgnkzsdihlrzvcwhitrbjnqksmczlkhdlzt", "mhsc", "scuhdiidtmuldgiofhqdizgfcubnxtefpef", "xspopvshpsgiwsibms"}), 160);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"nkxjpvfkwzaxoqhssjevqcgxdcbwfofyotcxmkdcenjpqfn", "xjpvfkwzaxoqhss", "sjevqcgx", "evqcgxdcbwfofyotcxmkdcenjpqfnsxwgxhhd", "dcbwfofyotcxmkdc", "bwfofyotcxmkdcenjpqfnsxwgxhhdyyvactmf", "enjpqfn", "fdngswpuzcyhqvwrnhnqabomgkzyibriguszn", "dngswpuzcyhqvwr", "puzcyhqvwrnhnqabomgkzy", "puzcyhqvwrnhnqabomgkzyibrigusznyjp", "cyhqvwrnhnqabomgkzyibrigusznyjpspwvn", "nhnqabomgkzyibrigusznyjpspwvnklspzqqnl", "hnqabomgkzyibrigusznyjpspwvnk", "abomgkzyib", "kzyibrigusznyjpspwvnklspzqqnlqrqxuzpy", "pspwvnklspzqqnlqrqxuzpynepmuh", "nklspzqqnlqrqxuzpynepmuhodcrao", "pzqqnlqrqxuzpynepmuhodcraotvegpclojockcurjcbbil", "nlqrq", "dcraotvegpclojockcurjcbbi", "r", "otvegpclojockcurjcbbilgajrmrwwdeyeaxgpcydaimagcy", "tvegpclojockc", "vegpclojockcurjcbbilgajrmrwwdeyeax", "urjcbbilgajrmrwwdeyeaxgpcydaimagcyhugfja", "wwdeyeaxgpcydaimagcyhugfja", "cydaimagcyhugfja", "cyhugfja", "fjas", "bczohdwxlkfxgilxjq", "kfxgilxjqhpzmvmarixhdxlfsaiibzubutefwthzlida", "ilxjq", "vmarixhdxlfsaiibzubutefwthzlidakgacdbnxgk", "ixh", "lfsaiibz", "dakgacdb", "dakg", "bnxgkwpcu", "kwpcubasptjjilwssjbfjgszqrfgkpqpfcyfgjm", "sptjjilwssjbfjgszqrfgkpqpfcyfg", "sjbfjgszq", "jgszqrfgkpqpfcyfg", "gszqrf", "zqrfgkpqpfcyfgj", "kpqpfcyfgjmblacflxcmtyhurxzc"}), 308);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"jzjqfqbkyoulmtucuqrolzazagoifoomnopcopb", "zzzzhtxcytcgnzyvblczccx", "yxibstnramjqfvvvqpxrlrvzrhgwhcqyjpktngi", "qfvvvqpxrlrvzrhgwhcqyjpktngikkne", "knewemuokpbwvefgbdqnbdznczrxvbmytrfhgjb", "qkzefgqwurb", "rtwbhqydghiivcgpwjnhyuxsihbpsiedqaauikgyvzddksbk", "uxsihbpsiedqaauikgyvzd", "ssbmdhegllibrhcirilkhuyauemvvmktvbwt", "xljlczdghcwlqjzlfuxjwhklhvomtcazxq", "tcazxqmcrlkydpdentcjycyjjsdzjgcevmspiddeyt", "cevmspiddeytkvpajacskdzvwqoigvnqzgtxnhhm", "zgtxnhhmqvzlctgdezhuraeytrvvzvngbdfk", "ytrvvzvngbdfkavvjdmeihisiaubmgdetlau", "zzkeldhyqepaehyhefzbd", "zzkeldhyqepaehyhefzbdiroi", "d", "sfrizjrlyybhufomeodbysybzs", "zugtimihikhftprmcwpo", "zxgrsbqapabsodzlpkiujcrfckjc", "omlrcfvovr", "wgkcwtxwmcxojiyrevglkfbisrmtxwbvgslzwhxvwoyg", "f", "xbsdvneaxmexxexpypwgygosjckufmiuzrmwpmojdoqqbczxk", "xxe", "rjkgyphlcfzpsppkyty"}), 606);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"hckkei", "inuqynqbscmomcmhdyqrvnrlxfkzis", "dyqrvnrlxfkzisyqzqediyp", "mqynryxsxzocusuodrdup", "eqp", "wgl", "qlcrqvwgaomdhltjxycmlaypbspoxahbqfyvudxvptwqvdo", "laypbspoxahbqfyvudxvptwqvdonxoufxo", "spoxahbqfyvudxvptwqvdonxoufxobsyiovbiwvrgkrj", "biwvrgkrjflb", "iwvrgkrjflbzhnzdmpljwwwptxfle", "avtseppicpenrgcxvpbtryyooabvngfoamipgpaejtg", "tryyooabvngfoamipgpa", "oamipgpaejtgwlealkbptzjnelhdtorn", "dmxprkkpqozqxq", "gttudeubpzwacjmibyrzbbhbmphdu", "tudeubpzwacjmibyrzbbhbmphdumrlf", "yjpsrjqnkjsjnlixsbjygpcxbsuuhdlacsfblqcehijq", "mvhdcyorqazgnsfrrajtmfjhdhrcvwfucfxeqswefkkgc", "zgnsfrrajtmfjh", "jtmfjhdhrcvwfucfxeqswefkkg", "tcoltdtbftizksonktzk", "evspueclekxwxmcacqpjmnoqymsfgriyhwboytpevod", "rrdubjfw", "as", "stabg", "wkurnnnvzzwxbjpbctlp", "awhjxzsbghzollfoeytuvsbdilolxtjldoxefzf", "vsbdilolxtjldoxefz", "hbkajoyfyjqqmlkqkjp", "abpkalmrdbxdlqjkndtadwlmg", "bxdlqjkndtadwlmgtxjsbkffcdrgt", "nlefamelwbpmihmd", "plpkxzitfynacwxinnulwjcquywl", "gmrasda", "wtm", "tynavoimylyeqfspaxndcopsoalkwpyxgbdkxjxystguaodh", "navoimylyeqfspaxndcopsoalkwpyxgbdk", "ckwcourszyghxbugncqgkbaqsgvumuj", "ropfsdjopmwykfwakgiaeubejfyvqtvvmbnhxjzfq", "cxceimsaibytxkaerezggnhtuuuvnmpiihdmyjs", "psfkrmr"}), 773);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"riuufw", "riuufwajidxrdqggyycexvjkqfkigkiwvtyc", "riuuf", "ufwajidxrdqggyy", "ajidxrdqggyycexvjkqfkigkiwv", "idxrdqggyycexvjkqfkigkiwvtycouj", "dxrdqggyycexvjkqfk", "xrdqggyycexvjkqfkigkiwvtycoujijx", "xrdqggyycexvjkqfkigkiwvtycoujijxpblil", "xrdqggyycexvjkqfkigki", "rdqggyycexvjkqfkigkiwvtycoujijxpblilokay", "yycexvjkqfkigkiwvtyco", "yycexvjkqfkigkiwvtycoujijxpbl", "ycexvjkqfkigkiwvtycoujijxpblilokay", "cexvjkqf", "exvjkqfkigkiwvtycoujij", "exvjkqfkigkiwvtycoujijxpbliloka", "vjkqfkigkiwvtycoujijxpblilo", "kqfkigkiwvtycoujijxpblilokaybpuj", "igkiwvtycouj", "ycoujijxpblilokaybpujiieazyuw", "ycoujijxpbliloka", "oujijxpblilokaybpujiieazyuwsjinxcuynqng", "oujijxpblil", "gouj", "ijxpblilok", "okaybpujiieazyuwsjinxcuyn", "aybpujiieazyuwsji", "ybpujiieazyu", "pujiieazyuwsjinxcuynqn", "jiieazyu", "iieazyuwsj", "e", "eazyuwsjinxcuynqng", "azyuwsjinxcuy", "azyuwsj", "azyuwsjin", "ws", "jinxcuynqngo", "jinxcuynq", "xcu", "cuyqm", "c", "y", "qngoe", "ng", "nga"}), 128);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"egvdkysxmyafhlqzqtgjprpxloplmiy", "sxlfiihvvgyvfkbqtvghtkweijz", "ihvvgyvfkbqtvghtkweijzotcvxwpotuatqqzydkuwy", "cfwbkpysvvpewrvgetbkooshgnniumnqmawqoedshvtl", "bkpysvvpewr", "hgbgjtedleshymicsf", "bdkdsr", "lxwbkjxnwzjcdlftkueidqwsqudeeinr", "nwzjcdlftkueidqwsq", "josuas", "ftwlrusizvktjlicydmumuqrfwxdkpxqoaorzndr", "itjexfsycqgxjztafotmbyvo", "kxeagmenboqhxkymxyttr", "uvurmghxdwihqcptfnwz", "ovonybdjcgyjuhsxp"}), 307);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"plicxniaihdgeugmfpirbjqtkdybjlxbtuqiuetmyynxsovuv", "vuviduxd", "tv", "nb", "huwhvekpyxnuoruhagqkj", "tiyckjryrzdwpsfujxpwfhrxktslmvkwdrtqbovvcuepqlxy", "yckjryrzdwpsfujxpwfhrxktslmvkwdrtqbovvcuepqlxyk", "epqlxyknzely", "cotrmvnyxvzvwdewkxgzivnlpjyryvisrouqijsuzz", "jsuzzvptrtdqkafryojycqjdabgqkokcwn", "ojycqjdabg", "nzmjstcjprsmirpdecbbvbaeuopdkwzhglrqlf", "ecbbvb", "opdkwzhglrqlfa", "vzbqddlkzouxjvrptcesxxnvzr", "xnvzrvxakqhrc", "dasgokdfvhlmrsnzinlaibegvxyutcqioglofojjxgjavlrl", "gyzxinadzfomhikdeynsmyxjbfbsxhwybwg", "ikdeynsm", "hgnaihmccnlomizikdnukeyorssflxhjdgipvssuffuwwabld", "nukeyorssflxhjdgipvssuffu", "nukeyorssflxh", "eyorssflxhjdgipvssuffuwwabldnj", "brkikggqxjrrjerlqmwwdgtljqflz", "flzgtqytgvqqfcyrrdxageauqahytcvnaufjoezud", "qytgvqqfc", "fcyrrdxageauqahytcvnaufjoezudsgfktyzua", "mjfsmrtwftfnilmblm", "biztigmqxwsrrcxnzmzaujchnc", "tmucybobqwnesdbilvid", "sdbilvidyslbrbwfsklvlnivccxjwljyajkono", "mopbxqlgagmdczgdtplapfgoah", "naharlhzjwqcuavzhwqfzosd", "acwqlesvlqypixgcnsrfnhbgdxxhzuyqqes", "wq"}), 665);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"awpzzeuzsoafyzvexgiraws", "ufakqduwbjlnfltldbxuavhvxwgnkhchhhwwgdzbdzcwx", "zoirrtqvkzzipyrs", "fvueaywtxjxohxnqivwjebmcacjsulwfr", "racrqhnyaahrjsoodoixhjitncjmvkitwadmpaflameyyzhe", "qygkpppyt", "magkzobkbsrctcwokedsgnhshaxwksohk", "ojtpsfu", "qywhbtnsradqpcwksybogbg", "mtxebwgvqhfmb", "xebwgvqhfmbmkwyyobyugwsqjiqrydeacxnysyaxs", "jiqrydeacxnysyaxstukupcbxolobpuay", "jgpi", "inrdalfwjkcnsbmqyizmckqmltpzdecpkugdvduuckhezx", "pqrpoxkrseygkyitskyooncyicuphjqkgdcryvoi", "seygkyitskyooncyicuphjqkgdcryvoioziplo", "yooncyicuphjqk", "iocvrmxzckk", "alrlytevthjtzjyfjtmjicymkqcr", "zjyfjtmjicymkqcrojbbxtbuoiserxbqrxuuyjzsnrzrg", "kqcrojbbxtbuoiserxbqrxuuyjzsnrzrgb", "rojbbxtbuoiserxbqrxuuyjzsnr", "zsnrcvkt", "cvkdtypuouyrbyyxwhxzsruapabicy", "pmqbxlnihyjozutfxatckfsjw", "mqbxlnihyjozutfxatckfsjwwmfkfronkvzjgiqikvukerii", "lskpfwlivuqffrwpmzyhmvwdhu", "jynpymcbmwsgvvdgfictyszpboqmiitxeqv", "shjmhjmxq", "hjmhjmxqcsxrmrwwjsfyvfcfmbonqr", "tagd", "tshsajjrqshpkpgc"}), 658);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"uvgjgeeuu", "olnkfeouhcafrkruktegdtyjctdvonwnljekbqhiydnw", "lnkfeouhcafrkruktegdtyjctdv", "ktegdtyjctdvonwnljekbqhiydnwyyytguxjpwbn", "tegdtyjct", "dtyjctdvonwnljekbqhiydnwyyytguxjpw", "tdvonwnljekbqhiydnwyyytguxjpwbnjfgzrmguerfhxpm", "rmguerfhxpmfwgcaxgxvxwcggosqyn", "fheoyze", "fgqjvbxpmbftuuhfsjpumhs", "jvbxpmbftuuhfsjpumhsibmblwqod", "yhfasrsskrppszkcosnohyxvlnnsgrzhzstxy", "nohyxvl", "mtvkhjfehofalnezrvaobsh", "fa", "hezf", "vvtoaavdhdhczoramzwkwnruneqwhnjrwdud", "wnruneqwhnjrwdudcprohyazhcueeunxnzyjuxwyg", "uneqwhnjrwdudcprohyazhcuee", "rh", "vdvxbnijpotyvs", "lzwcodbw", "wcodb", "ssh", "yzttqxdaconmb", "box", "xygspgmxyf", "yfeggsxhxnzhvadyehcqbk", "oklswe", "lswexndytvpjihgxjmy", "scgclvmcpmddlaieossenqjzk", "bqyxsarpe", "drnrazgggihwqpo", "drnrazg", "rpscuncmrgrrxwuwsdhwgvvgqrkqrbplbz", "dhwgvvgqrkqrbplbzqmyzclvcr", "v", "ybiqwlgruvdcsdvseolhwwpnom", "eolhwwpnomsvrrcwtluxsbmeffyvtad", "jmndafhi", "peltcumshuszldrqvxumflddrgja", "rqvxumflddrgjamw"}), 531);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"dexzldqzywu", "xzldqzywuliitderneyjlikdvgfasfxcihcilccskrgl", "dvgfasfxcihcilccskrg", "fasfxcihcilccskrglqnqwbmftuozcjbsamafgpklwxnclvds", "xcihcilccskrglqnqwbmftuozcjbsamafgpkl", "cskrglqnqwbmftuozcjbsamaf", "skrglqnqwbmftuozcjbsama", "bsama", "nclvdssxwwquibifdbeqmatqxhmhrcsehsnviwnqefft", "ifdbeqmatqxhmhrcsehsnviwnqe", "rmsircxayqmtebhgveooypltdrcjzrwuixcfhyki", "hgveooypltdrcj", "pltdrcjzrwuixcf", "uixcfhykiqsjekkgmensnucexosvswmimkrbih", "mimkrbihqmlvbfckpalukifxahwruhieleorobzdri", "mimkrbihqmlvb", "eorobzdrimbsemyhuovheuojxrwiyyxhsvkahyaqidzz", "iyyxhsvkahyaqidzzg", "zzgqsmpxwmzdbqxrgeaoyhxtcdpsaariqpceursfznmmtv", "wmz", "zdbqxrgeao", "qxrgeaoyhxtcdpsaa", "eaoyh", "mmtvhhopmgcgavklb", "upvfqajzmpldiekvvefskbaytopvlcngmijjbhcivfhecf", "fqajzmpldiekvvefskbay", "ekvvefskbaytopvlcngmijjbhcivfhecfzitjhkdbrg", "hcivfhecfzitjhkdbrgyegzaqlvh", "hsrz", "srzcuhqicimebaupqwnxgytbqsobnvnkkyh", "nx", "qsobnvnkkyhvqbwp", "qso", "qsola", "solan"}), 421);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bbbbabbeebecdcdbcdecaeccd", "cc", "ebcbbdecbdedbaebeebababebaaccacecddecedeceacacad", "cbbdec", "ede", "edbcbabbdadccddcdacacbeaeebbcbbbacade", "debccbccdedb", "accbabaececedbecdbaaabaeaeceeaeeadadbbdcca", "abecbecedcabacacdcdcbedec", "deccaeaaebcc", "dcbdebcddcabbceeaaccaaacdebaecbedaedd", "acbcbcba", "eedecceda", "be"}), 251);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"eceecedccaddeebeadadbddcdbecadb", "edccaddeebeadadbddcdbecadbcacdcedcc", "caddeebead", "bddcdbecadb", "cbebdbadbeebdeeacdbaabc", "eeacdbaabccedccaadadbebeddcbbb", "aabccedccaadadbebeddcbbbeeadeecddaceacaead", "eeadee", "dbebeddcbbbeeadeecddaceacaeaddeeecacbddabda", "bebeddcbbbeeadeecddaceacaeaddeeec", "cacbddabdabcaddbcdcabcbdaebbbcdecddabeddbac", "bcaddbcdcabcbdaebbbcdecddabeddb", "ddbaceabcbaacceddbaecdabaddb", "bcbaa", "aecdabaddbedcdecceccbcdebbceb", "bcdebbcebbdedcdabdecedadeaedcaebebbdadcaaebcadd", "addbeaeaaedeabbceabdaaedabcdbcdbccdd", "dcadabeaedcabccaaaceabbdabcaedaead", "aaaceabbdabcaedaeadadaeedbdceeadecaabced", "aaa", "cabaeebebecacedabbcceabdaeccabebcaaaedcccade", "acedabbcceabdaeccabebcaaaedccc", "ab", "cabebcaaaedcccadeaebabebece", "edcccadeaebabebececadbb"}), 401);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"baeedaecaedadcecdccaecacbeeb", "aedadcecdccae", "edcdbacdcc", "bddecedbdecbbddababaeaaabaebbacbaaeaeabcabce", "ababaeaaabaebbacbaaeaeabcabceeaaabc", "aeecdbbbabbeddadabeeeacdacbdecbcbdadbad", "cbdecbc", "deceeeaaeecaeabbbaabcacdaecadcbadad", "adcbadadeebceaabee", "ebbeabeaedabdddddeeeaaedebbeae", "ddeeeaaedebbeaea", "d", "baebaeaecdaddddccbeddcdeaadcedcabaab", "eaadcedcabaabebaa", "bbabecececcabdadcacebbcacadecbaeececeaccbdacae", "bcacadecbaeececeaccbdacaebbb", "ebbbcadceeeadecbdbcbaeaeb", "dabcbeeaeabcdbdaaebacbaaabbbcbcdaeecbcbedcebd", "edecceadddebecdcccbcaeadadeaedbdcdacddcebcaeb", "bedecbae", "edcccebcbddeabddbadacbaaddebedaecacebcaceda", "ccebcbddeabddba", "bedaecacebcacedaadceeceeac", "dce", "decbaabeddcbcdba", "cbaabbdaebdababacbbebcbbbbeacddebcbbbadecabd", "adbdbcdabdbaeeaceaddacdcebccebdeebbdcbdc", "bdbcdabdbaeeaceaddacdcebccebdeebbd", "dccbeddccabbecbaddbbebeacbebdcee", "acbebdceececdadaadaedabcbccceccccbbaddbdcebac", "baddbdcebacaedddadcabddaedbcd", "cedbdbbcdedeabdaeeaaceeeebcceebdbaecaddebeacca", "bdbaecaddebeaccadbec", "ac", "dbaaedaaabdedddecccdceeeabdcadedebdbe", "bdcadedebdbedebe", "ce"}), 737);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"dadceecbdeccccaaedeeabeea", "daacceeabee", "c", "aecbdeeeaaebbcdaada", "ddaabeddddbedddecccbeceabadddbabcbaacdcebcbc", "eddddbedddecccbeceabadddbabcbaa", "eddddbedddecccbeceabadddbabcba", "dbabadbbaabeceeedebbbccadd", "eceeedebbbcc", "cbcdebabeaebdeaaabddaddbbeeeda", "bbddbeedcbddbade", "dbeedcbddbadeadcbbcdaededccdabccddcecbd", "ddbadeadcbbcdaededccdabccddcecbddaacadabbddaad", "daacadabbddaadeabeaaadeaabcdbeceedabbdbddbacabbba", "cdebaeedabcadbecccabbeac", "aedcdbdeccebacdaceadcedbaaad", "beebcbbbcddcecdcaab", "bcbbbcdd", "adbeeddecddebdbdebaacaddeebeacbbcddc", "dc", "eabceeacaadbcbababcccadaba", "abcccadabaa", "acabd"}), 384);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bcdbdddcccbeaebedddcebdbadceedaaabcad", "aae", "dadceabadbabccecdcbadbcadaece", "eebedabbdbcabdcdedbbabeeeaeecccbde", "ccbdebcccbddeabbccbbabeaadbdcececcccecdbbdea", "bdeabcdebedadeedaacdbcbdbbcedecddabdbebbaedda", "bcbabeaeddcaaaadececdeeaeedeacaaccabacda", "eaeedeacaaccabacdadcdeadbaeacaeadacebbcae", "bbeacccebb", "badadbeabbbebabdedccbbadedde", "cecdeedcabedcecd", "bbb"}), 301);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abddaedebededbacecdeadadcaaadcbbabbaacbedabbb", "debededb", "dcbbabbaacbedabbbbedccbbcacbdbacdb", "bedabbbbedccbbcac", "dccbbc", "cacbdbacdbbcbddcdaabcaad", "aabc", "dcbeebbcbdaedcabcc", "aedcabccabeabdb", "beadedbeaddbaedadbdc", "addbaedadbdcbcdebcbc", "baedadb", "abedaaeebeeaceadab", "bddbeddccb", "dccbabbbcddedeccbbddbbebcbaec", "bcddedeccbbddbbebcbaecbccccaebcdaadbcceeeccaea", "eacebadebdcaecaadcbabedde", "cebade", "dcb", "bdddeb", "bed", "acbdeeeaebaaccacaecedcbbbdddbcacce", "acaecedcbbbdddbcacce", "cedcbbbdddbcacceaeadecaadeaacebbdaddc", "bdddacdaccbaebdebcacedbbed", "acdaccbaebdebcacedbbedeaabbcabecbbddacadedccea", "accbaebdebcacedbbedeaabbcabecbbddac", "deaabbcabecbbddacadedcceaaeacdedaed", "eaabbcabecbbddacadedcceaaeacdedaedddbeba", "bddacadedcceaaeacdedaedddbebacbd", "dacadedcceaaeacdedaedddbe", "edcceaaeacdedaed", "edaedddbebacbdbecdcebbbaadbdeeceeeebc", "aedddbebacbdbecdcebbba", "ebcbeaeccacbabdcac", "cacbabdcacecacaabbcdecceaeceaec", "cacaabbcdecceaeceaecddaceacddbdccccecadaee", "ddaceacddbdccccecadaeeeb", "cadaeeebceabdeeb", "beecacecbdbcbadcacdadeacaaccbbeeecdebbbeca", "aceddacbcacaeaebbedbeebaccb", "cbbbd"}), 519);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"cddacabcdbecdcbbdcbeabbacabbcbebda", "acabcdbecdcbbdcbeabbacabbcbebdabbdaaabdeb", "bdcccbcbdcacbe", "ccdaaadcabaceeae", "daaadcabaceeaeedccaabccccdbdcdacbbdbedebcdab", "cdacbbdbedebcdababebbdbcbecbdbccacdcbeadd", "bebbdbcbecbdbccac", "eceebeabaaadcbabbabccddebebadeecca", "cecbeabdbaaeeace", "cdddebcabd", "eaacebeccbac", "cdcdbbacacdaaabcdcadeccaecebccebcedadcd", "cbe", "ccaebdeaddedceeddaeeeecddaaeacbdedabbea", "ee", "dbbbbeeddeaedeceedecededaebbbeaceedbad", "edbadeaabbdacadadbceebcbc", "bdacadadbceebcbceedededcbccbbaece", "dbceebcbceedededcbccbbaecebdbaedbdeabeacbcdec", "eebcbceedededcbccbbaecebdbaedbdeabeacbcdecbadee", "baecebdbaedb", "cebdbaedbdeabeacbcd", "adbcd", "eaaaeabddceaceeeacdbe", "eaceeeacdbeacd", "ddcccbbabeceeeccbccbabbbeeccaaeaecbddcdab", "ccbccbabb", "b", "dbebabdeccabea", "eaeaaccdcabcddcaedeaac", "accdcabcddcaedeaa", "dd"}), 482);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"baeaedbcaebcaaaabeacbeaceacaeaeadda", "eacaeaeaddaaecebcceaaabee", "eacaadddc", "adddccbdaaaaedcdacecebeeacacdadccaa", "abbcdceeeeadbaabdebabaddddcacaabbabcaca", "cddecadecbabcabbdeecabaae", "cecdccbbddcadceaaaeebb", "bdebacaecdcecebebeacbcbcabcdbcdabdcacae", "bbdeacaaeddacaeadbddbecbedbdebccbaac", "cedcebdbdeeedcbdeedcbccceeaeeebaeeeebcaeedbdadba", "deeabadcddeeebbebeeeaedceabbdeedbbdaacceedabeced", "edabecedaaecdaebcdceeeecacebededbdbedaed", "adaeaacbae", "dda", "aedb"}), 389);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"dbd", "cbedecccebbbeab", "beccbceaaebacceceddabbede", "dbcedecaadaaecbceaaebbebcadeb", "ebcaeeccedbadeedddbdcaacdeabacddb", "ccedbadeedddbdcaacdeabacddbcc", "deabacddbccacdedbeabdebadeaeadaebeecebe", "cddbccacdedbeabdeb", "abecdbbdacaabecbeaadedbacbeabddddbaceccebd", "acbeabddddbaceccebdead", "aceccbecedc", "dcbacecdcbeadadeeabebdeaaac", "cdceb", "cebcaacadacecaaaedbddacedeedc", "abbceecbbddacdbccdecdaadadecad", "eecbbddacdbcc", "cbdeccd", "aceaddababecdeedabecdbeddbbaaceedcabdeecada", "cdeedabecdbeddbbaaceedcabdeecadabaeedbc", "cdeedabecdbeddbbaaceedcabdeecad", "deedaebeaaaeaaacdcbecddaaaddccdddca", "cabdbcdeebcdaeaccbbba", "eebcdaeaccbbbacbbcadebddebcaecbae", "bbaddceaaeadbabdbbabcddbcbdc", "eadbabdbbabcdd", "badecaacecceacdabbbdeebaaeccddebdebeeabebcecb", "acecceacdabbbd", "abebcecbbadeabbecabbeedddcacceebdcda", "cabbeedddcacceebdcdabdccbaadcdbebecebdcdcbace", "dccbaadcdbebecebdcdcbacebbdaddcbd", "dccbaadcdbebecebdc", "ccbaa", "dcacddecaebbeeebaebbbedaeedbcbba", "acabebecdebbceabdeeaeebbeceb", "eabdeeaeebbecebaebdaed", "eabdeeaeebbecebaebdaed", "eddcbddadebbeebdaebaeedeabcbabccebbbad", "bddadebbeebdaebaeedeab", "ee", "cbdabebcddcbbacee", "bbaceeebbaaabedbaab", "bbaaabe"}), 669);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"caedddcadebddaacd", "edbcdaeddeaacdecbceabecabbbeabddd", "decceebaabaaaccddceecaeaadac", "deceaadeaaececb", "deaaececbeabcccabbdacaae", "baede", "beceeebbdedcdabbbdcabbbcdbceeeacabbecaebc", "dae", "daeaadbcaabaaceaceeddacadd", "ceeddacaddcaddddbacacdcbcddabe", "baeedcacbdbaceaadbcbedcacadebdadcaacbbbbd", "dee", "abecaabcbcbbcbcdaedbbddbecd", "deeaeabad", "bccbd", "cddabcbacacdebebecedbccaaddec", "aecccaaeecbcececaaadeeaaeaaeddebc", "deebdababcbb", "acadcdeaeeeadeacadecacceaabcccebcbdadaadadbd", "ebdeddaeaebcbabacdcdebbdbedaebccdcbcdeabddc", "ebcbabacdcdebbdbedaebccdcbcdeabddcedccccaaba"}), 453);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abbbaaaabababbbbaabbaaaababaaba", "baaaabababbbbaabba", "aaaabababbbb", "a", "bababbbbaabbaaaababaabaaaabbaaaaaba", "ababbbbaabbaaa", "aaaababaabaaaabbaaaaabaaaabbaabb", "aaaababaabaaaabbaaaaabaaaabbaabbaaaba", "aaabbaaaaabaaaabbaabbaaabababaaa", "abbaaaaabaaaabbaabbaaabababaaaa", "baaaabbaabbaaa", "abbaabbaaabababaaaabbabaaababaaaaabaabaa", "baabbaaabababaaaabbabaaababaaaaabaaba", "baabbaaabababaaaabbabaaababaaaaabaaba", "aabbaaabababaaaabbabaaababaaaaabaabaababbbb", "bbaaabababaaaabbabaaababaaaa", "bbaaabababaaaabbaba", "aabababaaaabbabaaababaaaaabaabaababbbbabab", "babaaaabbabaaababaaaaabaabaababbbbab", "aabab", "aababaaaaabaabaababbbbababbbaaabab", "aaabaabaababbbbababbbaaababababbb", "aabaabaababbbbababbb", "aababbbbab", "abbbbababbbaaababa", "abbbbababbbaaababababbbbaaabbabbbaaaabaaabbbabb", "bbbaaababababb", "ababbbbaaabbabbbaaaabaaabbbabbbbaabbabbbaaaab", "bbbbaaabbabbbaaaabaaabbbabbbbaabbabbbaa", "baaabbabbba", "babbba", "bbaaaabaaabbbabbbbaab", "aaabbbabbbbaabbabbbaaaab", "aabbbabbbbaabb", "aabbbabbbba", "aabbbabbbbaabbabbbaaaabbbababaaaaabaaaabbb", "babbbbaabbabbbaaaabbbababaaaa", "abbbbaabbabbbaaaabbbababaaaaabaaaab", "bba", "aaaabaaaa", "ab", "abbba", "aa"}), 169);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aabaaababbbbbaaaabbbabbbbabbbbababaaaabbabb", "abbbbabbbbababaaaa", "abbbbababaaaabbabbbaba", "bbbbaaaabaaaababbbb", "aabbabbabaaabaaabbaaababbabbbabbabbbabaabbbabaaa", "aaabaaabba", "a", "babaaababaaaaaabaabbabababbabbababbbaaabababab", "babaaaaaabaab", "aaaaabaabbabababbabbababbbaaabababababaabaab", "aababbbaababbbbaaaabbabaaabbbabbba", "ababaabaabaabbabaaaabaabbbaaa", "bbbaaaaabaaaaaaaabbbbbabaabb", "aaaaabaaaaaaaabbbbbabaabbbbbbaaaabbabbaabbbab", "baaaaaaaabb", "aa", "bababbbaaaabbabaabbbabaababbaaabbaabbbbbb", "babbbaa", "a", "abbaaabbaabbbbbbababababbaba", "abbaabbbbbbababababbabaaabaa", "bbaabbbbbbababababbabaaabaababbaabab", "a", "babbabaaabaababbaababbaabaaabbbba", "aabaaabbbbaabbbaabaabbbaaaba", "abaabbababaabbabbaaa", "bbaaababababaababa", "ababaababababababbbaabaab", "aababababababbbaabaabaabaabbbab", "aababababababbbaabaabaa", "aabbbabbbbbababbaaabaabbbbbbaa", "baaabaabbbbbb", "bbbbbbaa"}), 434);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"baabbbabbbbbabbabaabaabbabbabbbbaababa", "abbaaba"}), 44);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"baaaaaabbbabbbaaaabaaababbaa", "bbbabbbaaaabaaababbaabbbbbbaaababaaababbabba", "babbaabbbbbbaaababaaababbabbabbbbaabbabba", "babaaababbabba", "bbab", "aaaaaaaaaaaabaababababaaaaabaabbbaaababbaaab", "aaababbabaabaababbbbaaababbbaaaa", "bbbbbaaabb", "aaabbbbabbbbaaaaaabbabaaaabaaaaabaabbaaa", "abbbbababbbbabaabbaaabbaababbbbaababbbaa", "babaabbaaabbaab", "baababbbaabbaabababaababaaba", "aabbaabababaababaabaabbbababbbbab", "abaabaabbbababbbbababaabba", "aababbaabababbbbaabbabaaababbbaabaababaaaba", "bbaabb", "babbbaab", "aabaaababbbbabbabbbaaabaabaaababababaabaab", "bbb", "abbabbbaaabaabaaababababaabaabbbabbbaabaab", "abaabaaababababaab", "bbbaabaabbbba", "ababbba", "aaabbababaaaaaaabaaaaabbaaaabaabab", "aaabbaaaabaababaaabaaaabbababaaabbbbbabaaabbababa", "abaaaabbababaaabbbbbabaaabbabababbbbaaaabbabbbaa", "baaaabbababaaabbbbbabaaabbabababbbbaaaabbabbb", "c", "babbbaaabababbabbaaabbaababaaaa", "baaabababba", "abbabbaaabbaababaaaaaabaaabbbbbabbaaabaaab", "abbaaabbaababaaaa", "abbaababaaaaaabaaabbbbb", "bbbbabbbbbbbbaabaabaaabbabaabbbbaabbbaba", "baabaabaaabbabaabbbbaabbbabaaaaababbaabbaaaab", "aaaaababbaabbaaaabbbaabaaabb", "aaaaababbaabbaaaabbbaabaaabbabbaaaaaaababb", "aabaaabbabbaaaaaaababbababbbab", "aaaaaababbababbbabbababbbabbabaabaabbab", "aaaababbab", "bbbbbba", "babaabababaabbabbaaaaabaab", "abbaaabbbabbbbbaaababbbbbaabaabbaa", "abbbabbbbbaaababbbbb", "babbbbbaabaabbaaabaaaabaababb", "b", "aab"}), 679);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"babaabbbaa", "abbbabbbbababaabaaaabbaabaabaabaabaaab", "bbabbbabababbaaabbabbaaabaababaabbbaaabbbab", "aba", "aaaaabaaaaaaaabbabbbbaababaabaabbaaa", "aaaa", "aaabbbbbaabbabbbbbbababbbabab", "baaaaababbbaaabbabbaabaab", "aaaaabbbaabbaabbabaaaaabaababbbbaba", "aaababbbbbbbbabaaaaababbaaaaaa", "aaaababbbbaabbbbbaabbbabbaabbbabaabbabbbbbababaab"}), 284);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaabaaabaaabbaabbabbba", "baaaaaabbbbbabaaaababbbaabaabaababbbbaaaaaabb", "bbaaabaa", "bbbbbabbabbaaabbbabbaabbbabaaaaaa", "a", "aaaaaabbaaa"}), 111);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"baaaaabbabbabaabaaaaab", "ab", "ba", "bbbbaabaaaaaaababbbaba", "abbbababbb", "babaab", "abaaabaabbbbbbabb", "abaabbbbaababbaaababb", "b", "aaabababa", "abaaababbaabbbbbaabbaaaa", "abaabbaaaaaabaaabbaaababaabbabbababbabaaaabbaabb", "baaaabbaabbaabbbbbaabaabbbabbabbbbab", "abbbaaaaaababaaaabbbabbbbbbabb", "ababaaabbabbbbaaabaaabbabbabbbaabaabbbbabaaabb", "bbabbbaabaabbbbabaaabbabbababbaaaabbaabbbbab", "babbbaabaabbbbabaaab", "abb", "abbbaaabbaaaaabaabbbababbabaabaabbabbabbbaababb", "babbbbbaaabaaabbbbaababbabbbbbababbabbba", "bbaabbaabaaab", "ababbbaabbababbbabbabababbabbaaabababb", "abbabbaaababab", "baabbbaaaaaababbbabbbabaab", "bbababababbaaabbaaabbaaaaababbaabbabbaababaaba", "aabaabbaaa", "bbbaaababbaaabbaabbbaabbbbaababababbabbabba", "aaaabbbbbbaabbabbaabbabaabaabbbaaaaabbb", "ba", "aaabbaabaaabaabbaa", "bbaaaabbababa", "abaaabbbbbbbbaabababbabaaabb", "abbbaababbababbabbbbbaabaababbb", "bbbbbaabaababbbbbaabbabaaabaabbbbabbabb"}), 673);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"baabbabbaaaabab", "aabb", "aabbbabbaaaababaabbbaaabbbbabaaaaa", "abaaaaabbbaabbbababaabaaabaaaabbbabbaaabbaaabaaab", "abbaaabaaab", "abababb", "aabaaaababababbaaaabaaaaaabab", "ababbbaaabbbbbabaab", "bbbaaa", "baaaababbb", "baaaaaaabaaababbaabbaabbbbababbabab", "bababaabbbbabbbbabababaaaabbabbbbbab", "ababaabbbbabbbbabababaaaabbabbbbb", "bbabbbbbabaabaabaaaabbbbbabbaaa", "abaabaaaabbbbbabbaaababbbbb", "a", "bbbbaba", "ababbab", "baabbbbbabaabbabaabbabaabaaaaaabbbab", "babbaaabbbababbaaaababbbaa", "bbbaaab", "babbaaabbabbabaaabaababbaabbabbaaa", "abaaaabba", "bbab", "aaabaabbbaababababbbbaba", "babababbbbabababababbbabbabaabbbbabbbaaaabbbbbaa", "bbabbabaabbbbabbbaaaabbbbbaaaabababbaababaabbaba", "aaaabbbbbaaaabababbaababaabbabaaabaabbbbaaba", "aabb", "babbbabaabbb", "bbbaaabbaababbbaabbabbbbabaabbbbabaabaabbba", "abbabbbbabaabbbbabaabaabbbaaaaabaababaa", "abababbbba", "bbaabbaaaabbabbabaaabbbbabaaaabba", "baaaabbaaabbbbbaabbbbbbbaaaaabbabaababbaa", "aaabbaaabbbbbaabbbbbbbaaaaabbabaababbaabbbabbbbab", "abbaabbbabbbbababbbabaabbb", "bbababbbabaab", "aabb"}), 598);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bba", "b", "aaabbabbbabbaaabbabbabababbbbb", "babbaabaabbaaaabbaababaabaababbbbababbabbab", "abbbbababbaaaabaaabbbbbbaababba", "babbba"}), 107);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bbabbbabbbbabbbaabaabaabba", "bbabbbabbbbabbbaabaabaabbabba", "babbbabbbbab", "babbbabbbbabbb", "abbbabbbbabbbaabaabaabbabbabbbababba", "bbbabbbaabaabaabbabbabbbababbaabbbaaabbaaaba", "abbbaabaabaabbabbabbbababbaabbbaaab", "ab", "baabbabbabbbababbaabbbaaa", "aabbabbabbbababbaabbba", "bbabbabbbababbaabbbaaabbaaab", "babbbababbaabbbaaa", "babbbababbaabbbaaabbaaabaab", "ababbaabbbaaabbaaabaabbaababbbbbbaabaaaababababb", "babbaabbbaaabbaaabaabbaababbbbbbaabaaaa", "babbaabbba", "bbaabbbaaabbaaabaabbaababbbbbbaabaaa", "aabbbaaabbaaabaab", "abba", "abbaaabaabbaababbbbbbaabaaaababababbabaaabaab", "baaabaabbaababbbbbba", "aabaabbaababb", "aabbaab", "aababbbbbbaabaaaababababbabaaabaaba", "babbbbbbaaba", "aa", "b", "abaaaabababa", "ababbabaaabaabaabbbbabaaaaaabaaababbbb", "babbab", "abbabaaabaabaabbbb", "baaa", "ab", "abaabbbbabaa", "bbabaaaaaabaaababbb", "bbabaaaaaa", "aaa", "baaababbbbbb", "aaababbbbbb", "a", "bbbbb", "bb", "b", "b", "ab", "ba", "b", "bab", "baab"}), 143);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"asd", "sdf", "dfg", "fgh", "hgj", "hjk", "jkl", "asd", "wqe", "zxc", "asd", "asd", "asd", "wqe", "sdaf", "hdgh", "xzc", "ahsdg", "wklqjl", "skladj", "xmc", "aklsjdlkajdlalkshfklalksh", "iwuoiklsajdkjldklalksdj", "mcnvaosd", "dfkjsghjkfh", "kjsdfdklsj", "asd", "kldsjfklsj", "jdkkd", "dsdsd", "dsdsds", "dsdsdsd", "dsdsklj", "kj", "kur", "mama", "ti", "deba", "pederast", "dolen", "da", "te", "eba", "v", "guza", "debel", "gaden", "dolen", "pedalski", "smachkan"}), 231);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "a", "b", "a"}), 3);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "ca", "abc", "ab", "pa", "a", "abc", "pabc", "a", "bca", "cpa", "acp", "abccaabcabpaaabcpabcabcacpaacp", "abc", "ca", "abc", "ab", "pa", "a", "abc", "pabc", "a", "bca", "cpa", "acp", "xx", "aaaaaaaaaaaaaaaaaaaa", "aaaaaaabcaaaa", "aaaaqq", "aaaaaqqqq", "aaaaaaaqqqqq", "qq"}), 101);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "aa", "aa", "aa", "aaaaaa", "aa", "aa", "aaaa", "aaa", "aa", "aa", "aaa", "a", "aaaaaaaaaaaa", "aaaaaaa", "aaaa", "aaa", "a", "aaaaaaaa"}), 12);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ababab", "ab", "ba", "ab", "ba", "ab", "ba"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "bc", "de", "ef", "abcdef"}), 12);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "ab", "de", "bc", "ef"}), 10);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcd", "bc"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "cde", "defgh", "g"}), 8);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "ccc", "cde"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdefg", "ab", "bc", "cd", "ef", "abcdef"}), 13);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"baba", "babae", "bababae", "cererer", "cerer", "erer", "mnm", "n", "nm"}), 22);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdefg", "ab"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "abss", "ss", "sa", "aab", "ac", "sobaka", "akkaunt", "aunter", "rres", "e", "kent"}), 30);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "ba", "a", "ba", "c", "cc", "ccc", "cccc", "cd", "ccd", "cc", "ccd", "ccdd", "ccddd", "ddd", "dbc", "ddbc", "dddbc", "dddb", "ddd", "dd", "d", "bc", "d", "dd", "ddd", "dd", "d", "ddw", "wbca", "www", "ww", "w", "bca", "wb", "wc", "wa", "aa", "aaa", "asdf", "sdf", "asd", "fd", "df", "ff", "f", "f", "d", "f"}), 59);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "aaa", "aaaaa"}), 5);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "bc", "def", "ghi", "fghi"}), 13);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "b", "c", "abca", "bca"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdes", "esf", "desesf"}), 13);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "ca", "dsjfsdkhfskldhfls", "fasdas", "asdasdasdasdasdasdasd", "aaaaaaaaaaaaaaa", "fffffffffffffffffff", "asfasdasdqwedqwdqwsdascdasaw", "qwdqwddsdasdwdfqwfqwfefedf", "qwdqwddasddddddwq"}), 148);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "bc", "bcdef", "abc", "abcde", "abcdf", "abcdefabcdeabcdfabcdef", "abc", "def", "bcdefa", "abcdefbc", "a", "b", "cd", "def", "bcdefcdefabc", "abcdefabcdef", "deabc"}), 70);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"asgdhfjgueeejdhfffjdejdddrrfrfffrf", "rfffr", "fffrfrhdjfssdfdjjghhjjshhdhhdjfhhdj", "hdj", "asgaaaaa", "ga", "gaa", "sga", "aaaa", "gagagagaga", "afartaartaartaarta", "artartartart", "artartartart", "artartpa", "art", "popopoooooppopopo", "pooppopopopo", "popopopo", "opopopopo", "popop", "popop", "opopppoo", "oopp", "popopppop", "klklkllllkkkll", "hghghhghhghh", "hghhghhhghhghhghhghhghhhghhghhghhghghhg", "hghhhghhg", "ghh", "h", "hgh", "hgh", "ghg", "qopqopqop", "poqpoqpoq", "q", "p", "o", "opq", "pqo", "pq", "po", "asd"}), 243);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaaaa", "ab", "c", "abc", "abcabccb", "aa", "aaeecdd"}), 24);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "bcd", "abcd", "cde", "edg"}), 11);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "ab", "bc", "de", "ef", "asdfg", "asrer", "erqwga", "asfd", "asg", "ad", "fa", "sdf", "asgas", "fa", "sf", "saf", "a", "wr", "sfasdfgagasdfasf", "asdfasdfag", "saf", "a", "fa", "sg", "z", "g", "a", "gasf", "as", "f", "asr", "wq", "r", "saf", "as", "fa", "sf", "w", "er", "wa", "r", "asf", "as", "f", "as", "r", "asfgasg", "ag", "a"}), 122);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaa", "a"}), 5);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bcdefcdef", "fcde", "ef"}), 9);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "abcab", "ab", "abc", "bcabd", "abd"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij"}), 50);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdadfdfdsafdag", "gfadgfa", "gfdaaaaaa", "yut"}), 34);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "b", "ab", "b", "b"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "ab"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "a", "a"}), 2);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "bc", "aefg"}), 10);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "ca", "abc", "abc", "ca"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abadc", "ad", "ab"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abba", "ab", "ba"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaa", "a", "aaaaa"}), 5);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaab", "ab", "aab"}), 9);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"auewogisj", "isjeugs", "wogisjis", "auewo", "abc", "bc", "sauew", "klsigjekwwq", "sbc", "sbc", "sbc", "wplkwwq", "auewogisjisjeus", "sbcwplkww"}), 78);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "abcd", "abc", "def", "lmnop", "mnop", "nop", "p", "qwertyu", "wertyu", "tyu", "yui", "hjkl", "jkl", "asdfgh", "fgh", "dfgh", "sdfghj", "fghjkl", "qwertyu", "tyuiop", "yuiop", "tiop", "opi", "iop", "klp", "lp", "qertyui", "rtyui", "poi", "oi", "qwerty", "yui", "uiop", "uiop", "abcd", "a", "b", "c", "d", "e", "f", "abcdef"}), 93);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "a", "a", "a", "a", "a", "a", "a"}), 1);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"qqqqqqqqqqqqqqqqqqqqqqqq", "wwwwwwwwwwwwwwwwwwwwww", "eeeeeeeeeeeeeeeeeeeeeeeeeeee", "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr", "tttttttttttttttttttttttttttttttttttttttt", "yyyyyyyyyyyyyyyyyyyyyyyy", "uuuuuuuuuuuuuuuuuuuuu", "iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii", "oooooooooooooooooooooooo", "pppppppppppppppppppp", "aaaaaaaaaaaaaaaaaaaa", "sssssssssssssssssssssss", "dddddddddddddddddddddd", "ffffffffffffffffffffffffffffffffff", "ggggggggggggggggggggggg", "hhhhhhhhhhhhhhhhhhhh", "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj", "kkkkkkkkkkkkkkkkkkkkkkkkk", "llllllllllllllllllllllllllllllllll", "zzzzzzzzzzzzzzzzzzzzz", "xxxxxxxxxxxxxxxxxxxxx", "cccccccccccccccccccccccccc", "vvvvvvvvvvvvvvvvvvvvvvvvv", "bbbbbbbbbbbbbbbbbbbb", "bbbbt", "t", "yyuuu", "uu", "yu", "u", "iiiiiiiiiiiiiiiiiiiiii", "wwwwwwwwwwwwwwww", "eeeeeeeee", "qqqqqqq", "sssssss"}), 709);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "acd"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "bcd", "cde", "cd"}), 5);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aabbcc", "bbcc", "bbcc"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "bc", "de", "ef", "abcdef", "def", "efg", "bcd", "abcdefgh"}), 24);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abacaba", "a", "ab", "aba", "bac", "acab", "abac", "aba", "c", "c", "cc", "c", "cc", "piko", "l", "pikol", "afonyayayayayayayaayayayayayayayaayayayayaayayaya", "afonyayayayayayayaayayayayayayayaayayayayaayayaya", "ayayayaayayayayayayayaayayayayaayayaya", "yaayayayayaayayaya", "aa", "abracadabra", "bra", "ra", "aa", "braa", "raaaaaa", "l", "q", "f", "sssssss", "alisa", "salisa", "alisa", "alisalisa", "dsfsdaf", "sdfasgrew", "sdfrweifdsgweriojufdlskjaiechawpaseunxfcafda", "eawfdsfeuwfdasf", "hgfhfgh", "safaeaefeawf", "dsafsdfghdsfhgs", "sdafasdfasdfsadfsad", "pika", "sdf", "pika", "aly", "yyy", "yyyy", "alyyyyyyy"}), 262);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcab", "ca", "ab", "ca"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"mama", "ama", "aqo", "yq", "qo", "amaq", "amaq", "w", "w", "a", "a", "m", "a", "m", "fsd", "fg", "re", "rgdf", "g", "gs", "s"}), 31);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcbc", "bc", "fg"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"moo", "opalllllllll", "lllll", "lalalalaa", "aalo"}),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bbbbbbbbbbbbbbbbbbbbbb", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}), 2450);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "defab", "abc"}), 9);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"fadsafd", "sdsf", "fsadff", "sfafdsqr", "fadff", "dasfa"}), 34);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aab", "abcdefghij", "abcdefghijklmn"}), 15);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcde", "bcx"}), 8);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "aba", "abab"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "bcdefg"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ababc", "abd"}), 8);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "abcd", "bc", "ef", "bcd", "bc", "b", "bb", "hy", "hyy", "yyj", "yjkl", "yjkll", "kllty"}), 20);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdabc", "d", "ab"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "bca", "bc"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcd", "cdef"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"qwer", "qw", "ew", "rewq", "qwer", "rew", "we", "rew", "re"}), 19);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "abc"}), 3);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}), 50);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"mama", "ama", "aqo", "yq", "qo", "amaq", "amaq", "wwaw", "w", "w", "aajksjdk", "sjdajs", "saka", "skjhdao"}), 41);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"auewogisj", "isjeugs", "wogisjis", "auewo", "abc", "bc", "sauew", "klsigjekwwq", "sbc", "sbc", "sbc", "wplkwwq", "auewogisjisjeus", "sbcwplkww", "kaowiejgksd", "kao", "kao", "qrst", "kaowiej", "kaqr", "wiejka"}), 110);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "bc", "ab"}), 5);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abde", "bc", "de", "ef", "abcdef"}), 15);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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"aaaa", "aaa", "aa", "a"}), 50);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcd", "cde"}), 5);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdefghijklmnopqrstuvwxyz", "klmnop", "nop", "pqr", "qrst"}), 26);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abababababcddfdfggf", "ababcd", "dfdf"}), 19);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "abcd"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abadce", "ad", "dc"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"dfazef", "zefff", "ffff", "azeggth", "g", "gth", "azz", "ertt", "tyhtyhjj", "hhh", "heh", "qsffsdffaf", "azzza", "a"}), 50);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "def", "defg"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "abc"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "bc", "de", "ef", "abcdef", "abc", "cacc", "caaaaa", "aaaca", "acacac", "ac", "ca", "acac", "acrush", "rushendash", "dasho", "shodown"}), 41);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "cd"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "b", "a"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "de", "ab"}), 8);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "c", "abc", "ab", "c", "bc", "abc", "a", "a", "a", "abc", "c"}), 11);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "a", "c", "b"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "qrstuv", "qrs"}), 9);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcd", "ax"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaaaa", "ab", "c", "abc", "abcabccb", "aa", "aaeecdd", "cdsdfasgweaohi", "fcodsgf", "awegia", "asdgthh", "wegsdf", "dfsdgwedsf", "dfsdfsdfsdfdsfs", "dfsdfsdf", "dfsdfsdf"}), 86);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "ac"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "def", "abc"}), 9);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcecde", "cde", "ce"}), 9);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"asdasdas", "asda", "asjhdk", "as", "asfdasdfasjfklasjlk", "asgfhgajsdfkgasdfasdfasdf", "asdfasda", "fdsa", "fd", "asdfghte", "sd", "asfdsa", "sdfasdhfgas", "asfasdfafefasd", "sdfcasd", "sd", "f", "fca", "sd", "ca", "s", "dc", "s", "d", "f", "we", "a", "s", "d", "fsd", "f", "asd", "asc", "sdc", "s", "dc", "sdfasdfasd", "f", "seas", "d", "fd", "fas", "f", "d", "fas", "af", "sa"}), 158);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bca", "cau"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abab", "ab", "aba"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"asdf"}), 4);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "ba", "ac"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"a", "a", "a", "a"}), 1);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "ab", "bc", "de", "ef", "ininininty", "ininazz", "isininity", "init", "asdf", "dsfasgasdg", "zy", "yzyz", "yzyz", "annn", "nnv"}), 56);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "bc", "de", "ef", "abcdef", "ef", "f", "f", "f", "f", "f", "g", "g", "rt", "rte", "rrd", "ered", "d", "d", "d", "d", "d", "d", "d", "ppp", "po", "opo", "o", "o", "o", "o", "oytutyu", "fg", "ggg"}), 39);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcd", "bc", "efg", "ef", "efgh", "aaaaaaaaa"}), 17);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ab", "cd", "c", "ab"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcd", "cd", "bc"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aabbcc", "abc"}), 9);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abdef", "abc"}), 8);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcd", "bcde"}), 5);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "abcyui"}), 12);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bac", "baa"}), 6);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"maria", "rihana", "ariana", "ana", "a", "n"}), 16);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"ababa", "ababd"}), 7);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaa", "a"}), 3);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abcdef", "ef", "ab"}), 8);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"aaaaaaaaa", "aa", "aaaaaabbb"}), 12);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"abc", "cde", "efg", "ghi"}), 9);
      eq(0, (new OrderedSuperString()).getLength(new String[]{"bc", "ef", "abcdef", "ab", "de"}), 10);

    } catch (Exception exx) {
      System.err.println(exx);
      exx.printStackTrace(System.err);
    }
  }
// END CUT HERE
}
